package org.demo.patten.observer;

/**
 * @author zhuj
 * @date 2025/3/29
 * @apiNote
 */
public class Main {
    public static void main(String[] args) {
        WeatherStation station = new WeatherStation();
        Observer phone1 = new PhoneDisplay("小明的手机");
        Observer phone2 = new PhoneDisplay("小红的平板");
        station.attach(phone1);
        station.attach(phone2);
        station.setWeather("晴天 ☀️");
        station.setWeather("下雨 🌧️");
        station.detach(phone2);
        station.setWeather("暴雪 ❄️");
    }
}
